<!DOCTYPE html>
<html>
<head>
<meta content="telephone=no" name="format-detection">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="zh-CN">
<meta http-equiv="x-ua-compatible" content="IE=edge, chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<meta name="keywords" content="关键词" />
<meta name="description" content="页面简介" />
<link rel="icon" href="favicon.ico" />
<link rel="shortcut icon" href="favicon.ico" />
<link href="csaa/css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="./csaa/fonts/iconfont/iconfont.css">
<link rel="stylesheet" href="./csaa/fonts/materialicons/material-icons.css">

<script language="javascript" type="text/javascript" src="csaa/js/jquery.min.js"></script>
<script src="./csaa/js/jquery.qrcode.min.js"></script>

<script language="javascript" type="text/javascript" src="./csaa/js/site.js"></script>
<script src="csaa/js/httpPath.js"></script>
<script src="csaa/js/httpUtils.js"></script>
<title>全国青少年航空科学素质等级考试</title>
</head>
<body>
<!-- 头部 开始 -->
<div class="header">

</div>
<!-- 头部 结束 -->


<!-- 内页banner 开始 -->
<div class="in_banner">
	<div class="in_banner_box" style="background-image: url(./demo/img/banner01.jpg)
	"></div>
	<div class="text">趣味课堂：无人机编程云课堂</div>
</div>
<!-- 内页banner 开始 -->

<!-- 主体 开始 -->
<div id="newsinfo_main">
	<div class="main">
		<div class="bread">
			<span class="bread_title">当前位置：</span>
			<div class="list">
				<a class="item" href="./index.html">首页</a>
				<a class="item" href="./video_list.html">无人机编程云课堂</a>
			</div>
		</div>
		<div class="newsinfo_content card">
			<div class="title">
				<span class="badge badge_color_1" id="news_type"></span>
				<span class="text" id="news_title">趣味课堂：无人机编程云课堂</span>
			</div>
			<hr>
			<div class="learn_video_list" id="learn_video">
                <div class="learn_video_box">

                </div>
                <a class="main_more">正在载入…</a>
			</div>
			<div class="manage_btnwrap">
				<!-- <a class="btn btn_color_1 btn_down" href="./demo/uploads/全国青少年无人机科学素质等级考试标准v6.9.docx" target="_blank"><i class="material-icons"></i></a> -->
			</div>
		</div>
		<div class="latest_news card">
			<div class="latest_title"><i class="material-icons">&#xe05e;</i><span class="text">最新动态</span></div>
			<div class="list_latest">

			</div>
			<div class="manage_btnwrap">
				<a class="btn btn_color_1" href="./news.html">查看更多</a>
			</div>
		</div>



    </div>
    <!-- 视频播放模板 开始 -->
    <div id="video_popup" class="hide">
        <div class="mask"></div>
        <div class="video_popup_box">
            <div class="video_content">
                <div class="close_video"><i class="material-icons">&#xe5cd;</i></div>
                <video controls id="video_url">
                    <source type="video/mp4">
                    对不起！您的浏览器不支持此视频播放，请升级你的浏览器。
                  </video>
            </div>
        </div>
    </div>
    <!-- 视频播放模板 结束 -->
    <!-- 视频列表项模板 开始 -->
    <div id="tmp_item_video" style="display: none;">
        <div class="item">
            <div class="item_box">
                <div class="img_wrap">
                    <div class="img" style="background-image: url();"></div>
                    <div class="item_mask">
                        <i class="material-icons">&#xe038;</i>
                    </div>
                </div>
                <div class="text_wrap">
                    <div class="name"></div>
                    <!-- <div class="author_text">作者：<span class="author">--</span></div> -->
                    <div class="time_text">上传时间：<span class="time">--</span></div>
                </div>
            </div>
        </div>
    </div>
    <!-- 视频列表项模板 结束 -->

	<!-- footer 开始-->
	<div class="footer_wrap">

	</div>
	<script>
		fun_islogin(true);//页面头部登录


        var scrollload = {};
        var pauseload = {};
        //载入视频列表
        var ajax_video_list;
        $("#learn_video").on("click", ".main_more", function(){
        if( pauseload.video_list ) {
            return false;
        }
        pauseload.video_list = 1;

        //暂停滚动载入新内容
        scrollload.video_list = 0;

        var $tmp_this_card_more = $(this);

        var tmp_video_page = $(this).data("page") ? $(this).data("page") : 1;

        if( tmp_video_page <= 1 ) {
            if( ajax_video_list ) {
            ajax_video_list.abort();
            }
            $(".learn_video_box").html("");
        }

        var tmp_params = {
            "pageNum": tmp_video_page,
            "pageSize": 10
        }
        //console.log( tmp_params );
        ajax_video_list = $.ajax({
            type: "GET",
            datatype: "json",
            url: GET_VIDEO_LIST,
            data: tmp_params,
            beforeSend: function(){
            $tmp_this_card_more.html( "正在载入…" );
            },
            success: function(data){//typeof
            if( typeof data != "object" ) {
                data = $.parseJSON(data);
            }

            if( data.status == 1 ) {
                var $tmp_html = $("<div/>");
                var fetch_data = data.data;
                //没有更多内容了
                if( fetch_data.length == 0 ) {
                    $tmp_this_card_more.html( "没有更多内容了" ).addClass("nomore");
                    pauseload.hqgoods_list = 0;
                    return false;
                }
                for(var i = 0; i < fetch_data.length; i++) {
                var $tmp_item = $("#tmp_item_video .item").clone();

                $tmp_item.find(".img").attr("data-lazybgimg", fetch_data[i].logo);

                $tmp_item.find(".name").html( fetch_data[i].title );
                //$tmp_item.find(".author").html( "本站" );
                $tmp_item.find(".time").html( fetch_data[i].createTime );

                $tmp_item.attr("data-url", fetch_data[i].url);



                $tmp_item.data( "video_id", fetch_data[i].id );

                $tmp_html.append( $tmp_item );
                }

                $tmp_html.find(".item").appendTo( ".learn_video_box" );

                //允许滚动载入新内容
                scrollload.video_list = 1;

                //页数累加
                tmp_video_page++;
                $tmp_this_card_more.data( "page", tmp_video_page );
                lazy();
                $tmp_this_card_more.html( "点击载入更多" );

                pauseload.video_list = 0;

            }
            //载入失败
            if( data.status == 0 ) {
                $tmp_this_card_more.html( "载入失败，点击重试" );
                $.fn.winktips("载入失败 ( >﹏<。)");
                pauseload.video_list = 0;
            }
            return false;

            },
            error: function(){
            if(status !== "abort"){
                $tmp_this_card_more.html( "载入失败，点击重试" );
                $.fn.winktips("载入失败 （/TДT)/");
                pauseload.video_list = 0;
            }
            }

        });

        });
        $("#learn_video .main_more").data( "page", 1 ).click();

        //滚动载入新内容
        $(window).scroll(function() {
        if( scrollload.video_list ) {
            scrollLoad( $("#learn_video .main_more") );
        }
        });




		// 载入最新动态
		$.ajax({
			type: "POST",
			url: GET_NEWS_LIST,
			dataType: "json",
			data: {pageSize:8, pageNum:1},
			timeout: 20000,
			success: function(data){
				var fetch_data = data.data;

				if( data.status == 1 ){
					if( !fetch_data.length ) {
						$(".list_latest").html("<div class=\"nothing\">暂无内容</div>");
						$(".latest_news .manage_btnwrap").hide();
					} else {
						var $tmp_item = "";
						$.each( fetch_data, function(i,n){
							$tmp_item += '<a class="item" href="./news_info.html?id='+n.id+'"><div class="text">'+n.title+'</div><div class="time">'+toDateStr(n.createDate)+'</div></a>';

						});
						$(".list_latest").append( $tmp_item );
					}
				}
			}
        });

        //弹出视频窗
        $(document).on("click", "#learn_video .item", function(){
            $("#video_popup").removeClass("hide");
            bodyfixed(1);
            var thisurl = $(this).data("url");
            $("#video_url").attr("src", thisurl );

        });
        //关闭视频窗
        $(document).on("click", ".close_video", function(){
            $("#video_popup").addClass("hide");
            bodyfixed(0);
            $("#video_url").prop("src", "" )
        });
	</script>



<!------------------------------------ 主体分割 -------------------------------->



</div>
<!-- 主体 结束 -->


</body>
</html>











